#!/usr/bin/env sh
#work directory 
#$HOME/git
cur_dir=`pwd`

tgt_dir=(git r90)
tgt_path=($HOME/git
$HOME/git/r90
)

ctags_flag="--totals=yes --links=yes --sort=yes \
    --languages=c++ --langmap=c++:+.inl -h +.inl --c++-kinds=+pmlcdefgnstuvx --fields=+aiKSzns --extra=+qf \
    --exclude=.svn--exclude=.git --exclude=*.bak --exclude=tmp"

if [ "$1x" == "${tgt_dir[0]}x" ] ; then

    work_dir=${tgt_path[0]}
    cd $work_dir

    ctags -R $ctags_flag --exclude=r90  --exclude=hdocs --exclude=tarball ./

    cd $cur_dir

elif [ "$1x" == "${tgt_dir[1]}x" ] ; then

    work_dir=${tgt_path[1]}
    cd $work_dir
    ctags -R $ctags_flag --exclude=cfg --exclude=hdocs --exclude=tarball --exclude=gtest --exclude=SmartGuys --exclude=R9-cloud ./

    cd $cur_dir;

elif [ "$1"x = ""x ] || [ "$1"x="h"x ] || [ "$1"x="help"x ] ; then

    echo "usage: $0 ${tgt_dir[*]}"

fi

